import 'package:flutter/material.dart';

void main() => runApp(const MaterialApp(home: DemoContainerWidget(),));

///
/// container_demo.dart
/// `{Key? key}` 必须放在 {} 中
///
class DemoContainerWidget extends StatelessWidget {
  const DemoContainerWidget({Key? key}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    final result = Scaffold(
      appBar: AppBar(title: const Text('ch14 Container demo')),
      body: Container(
        padding: const EdgeInsets.all(18.0),
        margin: const EdgeInsets.all(44.0),
        width: 180.0,
        height: 240,
        alignment: Alignment.center,
        decoration: BoxDecoration(
          color: Colors.red,
          borderRadius: BorderRadius.circular(10.0)
        ),
        child: const Text(
          'Container（容器）在UI框架中是一个很常见的概念，Flutter也不例外。',
          style: TextStyle(fontSize: 19),
        ),
      ),
    );
    return result;
  }
}


